export default function install(app){
  // 所有组件出口文件 ,files是一个函数
  const files = require.context('@/components', true, /(.js)$/)
  console.log(files)
  files.keys().forEach(filePath => {
    // filePath是字符串
    const component = files(filePath) //相当于import * as component from 'filePath'
    console.log(component)
    const componentName = Object.keys(component)
    componentName.forEach(name => {
      app.component(name, component[name])
    })
  })
}